package com.example.module.custom.utils;

import android.content.Context;
import android.graphics.Point;
import android.view.Display;
import android.view.WindowManager;

/**
 * @name BlockDemo
 * @class name：com.example.module.custom.utils
 * @classdescribe
 * @anthor ljp
 * @time 2020/1/16 14:58
 */
public class ScreenSizeUtils {
    public static Point getScreenSizeInfo(Context context) {
        WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
        Display display = null;
        if (manager != null) {
            display = manager.getDefaultDisplay();
            Point sizePoint = new Point();
            display.getSize(sizePoint);
            return sizePoint;
        } else {
            return null;
        }
    }

}
